"""
@author: xxw
@file: 从大到小排序.py
@time: 2023/5/5 11:30
"""

def quicksort(arr):
    if len(arr) <= 1:
        return arr
    pivot = arr[len(arr) // 2]
    left = [x for x in arr if x > pivot]
    middle = [x for x in arr if x == pivot]
    right = [x for x in arr if x < pivot]
    return quicksort(left) + middle + quicksort(right)

array = [1,5,0,4,7,8,2]
print(quicksort(array))
